3.1.34 \(\int (c+d x)^2 \sec ^2(a+b x) \, dx\) [34]

Optimal. Leaf size=82 \[ -\frac {i (c+d x)^2}{b}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}-\frac {i d^2 \text {PolyLog}\left (2,-e^{2 i (a+b x)}\right )}{b^3}+\frac {(c+d x)^2 \tan (a+b x)}{b} \]

[Out]

-I*(d*x+c)^2/b+2*d*(d*x+c)*ln(1+exp(2*I*(b*x+a)))/b^2-I*d^2*polylog(2,-exp(2*I*(b*x+a)))/b^3+(d*x+c)^2*tan(b*x
+a)/b

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {4269, 3800, 2221, 2317, 2438} \begin {gather*} -\frac {i d^2 \text {Li}_2\left (-e^{2 i (a+b x)}\right )}{b^3}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {i (c+d x)^2}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)^2*Sec[a + b*x]^2,x]

[Out]

((-I)*(c + d*x)^2)/b + (2*d*(c + d*x)*Log[1 + E^((2*I)*(a + b*x))])/b^2 - (I*d^2*PolyLog[2, -E^((2*I)*(a + b*x
))])/b^3 + ((c + d*x)^2*Tan[a + b*x])/b

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3800

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[I*((c + d*x)^(m + 1)/(d*(m + 1))), x
] - Dist[2*I, Int[(c + d*x)^m*(E^(2*I*(e + f*x))/(1 + E^(2*I*(e + f*x)))), x], x] /; FreeQ[{c, d, e, f}, x] &&
 IGtQ[m, 0]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps

\begin {align*} \int (c+d x)^2 \sec ^2(a+b x) \, dx &=\frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {(2 d) \int (c+d x) \tan (a+b x) \, dx}{b}\\ &=-\frac {i (c+d x)^2}{b}+\frac {(c+d x)^2 \tan (a+b x)}{b}+\frac {(4 i d) \int \frac {e^{2 i (a+b x)} (c+d x)}{1+e^{2 i (a+b x)}} \, dx}{b}\\ &=-\frac {i (c+d x)^2}{b}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \tan (a+b x)}{b}-\frac {\left (2 d^2\right ) \int \log \left (1+e^{2 i (a+b x)}\right ) \, dx}{b^2}\\ &=-\frac {i (c+d x)^2}{b}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}+\frac {(c+d x)^2 \tan (a+b x)}{b}+\frac {\left (i d^2\right ) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{b^3}\\ &=-\frac {i (c+d x)^2}{b}+\frac {2 d (c+d x) \log \left (1+e^{2 i (a+b x)}\right )}{b^2}-\frac {i d^2 \text {Li}_2\left (-e^{2 i (a+b x)}\right )}{b^3}+\frac {(c+d x)^2 \tan (a+b x)}{b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.17, size = 75, normalized size = 0.91 \begin {gather*} \frac {-i d^2 \text {PolyLog}\left (2,-e^{2 i (a+b x)}\right )+b (c+d x) \left (-i b (c+d x)+2 d \log \left (1+e^{2 i (a+b x)}\right )+b (c+d x) \tan (a+b x)\right )}{b^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)^2*Sec[a + b*x]^2,x]

[Out]

((-I)*d^2*PolyLog[2, -E^((2*I)*(a + b*x))] + b*(c + d*x)*((-I)*b*(c + d*x) + 2*d*Log[1 + E^((2*I)*(a + b*x))]
+ b*(c + d*x)*Tan[a + b*x]))/b^3

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 169 vs. \(2 (76 ) = 152\).
time = 0.07, size = 170, normalized size = 2.07

method result size
risch \(\frac {2 i \left (d^{2} x^{2}+2 c d x +c^{2}\right )}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}-\frac {4 d c \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {2 d c \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right )}{b^{2}}-\frac {2 i d^{2} x^{2}}{b}-\frac {4 i d^{2} a x}{b^{2}}-\frac {2 i d^{2} a^{2}}{b^{3}}+\frac {2 d^{2} \ln \left ({\mathrm e}^{2 i \left (b x +a \right )}+1\right ) x}{b^{2}}-\frac {i d^{2} \polylog \left (2, -{\mathrm e}^{2 i \left (b x +a \right )}\right )}{b^{3}}+\frac {4 d^{2} a \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}\) \(170\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)^2*sec(b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

2*I*(d^2*x^2+2*c*d*x+c^2)/b/(exp(2*I*(b*x+a))+1)-4*d/b^2*c*ln(exp(I*(b*x+a)))+2*d/b^2*c*ln(exp(2*I*(b*x+a))+1)
-2*I*d^2/b*x^2-4*I*d^2/b^2*a*x-2*I*d^2/b^3*a^2+2*d^2/b^2*ln(exp(2*I*(b*x+a))+1)*x-I*d^2*polylog(2,-exp(2*I*(b*
x+a)))/b^3+4*d^2/b^3*a*ln(exp(I*(b*x+a)))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 324 vs. \(2 (73) = 146\).
time = 0.58, size = 324, normalized size = 3.95 \begin {gather*} \frac {2 \, b^{2} c^{2} + 2 \, {\left (b d^{2} x + b c d + {\left (b d^{2} x + b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (-i \, b d^{2} x - i \, b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \arctan \left (\sin \left (2 \, b x + 2 \, a\right ), \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x\right )} \cos \left (2 \, b x + 2 \, a\right ) - {\left (d^{2} \cos \left (2 \, b x + 2 \, a\right ) + i \, d^{2} \sin \left (2 \, b x + 2 \, a\right ) + d^{2}\right )} {\rm Li}_2\left (-e^{\left (2 i \, b x + 2 i \, a\right )}\right ) + {\left (-i \, b d^{2} x - i \, b c d + {\left (-i \, b d^{2} x - i \, b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (b d^{2} x + b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (\cos \left (2 \, b x + 2 \, a\right )^{2} + \sin \left (2 \, b x + 2 \, a\right )^{2} + 2 \, \cos \left (2 \, b x + 2 \, a\right ) + 1\right ) - 2 \, {\left (i \, b^{2} d^{2} x^{2} + 2 i \, b^{2} c d x\right )} \sin \left (2 \, b x + 2 \, a\right )}{-i \, b^{3} \cos \left (2 \, b x + 2 \, a\right ) + b^{3} \sin \left (2 \, b x + 2 \, a\right ) - i \, b^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2*sec(b*x+a)^2,x, algorithm="maxima")

[Out]

(2*b^2*c^2 + 2*(b*d^2*x + b*c*d + (b*d^2*x + b*c*d)*cos(2*b*x + 2*a) - (-I*b*d^2*x - I*b*c*d)*sin(2*b*x + 2*a)
)*arctan2(sin(2*b*x + 2*a), cos(2*b*x + 2*a) + 1) - 2*(b^2*d^2*x^2 + 2*b^2*c*d*x)*cos(2*b*x + 2*a) - (d^2*cos(
2*b*x + 2*a) + I*d^2*sin(2*b*x + 2*a) + d^2)*dilog(-e^(2*I*b*x + 2*I*a)) + (-I*b*d^2*x - I*b*c*d + (-I*b*d^2*x
 - I*b*c*d)*cos(2*b*x + 2*a) + (b*d^2*x + b*c*d)*sin(2*b*x + 2*a))*log(cos(2*b*x + 2*a)^2 + sin(2*b*x + 2*a)^2
 + 2*cos(2*b*x + 2*a) + 1) - 2*(I*b^2*d^2*x^2 + 2*I*b^2*c*d*x)*sin(2*b*x + 2*a))/(-I*b^3*cos(2*b*x + 2*a) + b^
3*sin(2*b*x + 2*a) - I*b^3)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 450 vs. \(2 (73) = 146\).
time = 0.43, size = 450, normalized size = 5.49 \begin {gather*} \frac {i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) - i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right )\right ) + i \, d^{2} \cos \left (b x + a\right ) {\rm Li}_2\left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right )\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) + \sin \left (b x + a\right ) + 1\right ) + {\left (b d^{2} x + a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-i \, \cos \left (b x + a\right ) - \sin \left (b x + a\right ) + 1\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + i\right ) + {\left (b c d - a d^{2}\right )} \cos \left (b x + a\right ) \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + i\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \sin \left (b x + a\right )}{b^{3} \cos \left (b x + a\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2*sec(b*x+a)^2,x, algorithm="fricas")

[Out]

(I*d^2*cos(b*x + a)*dilog(I*cos(b*x + a) + sin(b*x + a)) - I*d^2*cos(b*x + a)*dilog(I*cos(b*x + a) - sin(b*x +
 a)) - I*d^2*cos(b*x + a)*dilog(-I*cos(b*x + a) + sin(b*x + a)) + I*d^2*cos(b*x + a)*dilog(-I*cos(b*x + a) - s
in(b*x + a)) + (b*c*d - a*d^2)*cos(b*x + a)*log(cos(b*x + a) + I*sin(b*x + a) + I) + (b*c*d - a*d^2)*cos(b*x +
 a)*log(cos(b*x + a) - I*sin(b*x + a) + I) + (b*d^2*x + a*d^2)*cos(b*x + a)*log(I*cos(b*x + a) + sin(b*x + a)
+ 1) + (b*d^2*x + a*d^2)*cos(b*x + a)*log(I*cos(b*x + a) - sin(b*x + a) + 1) + (b*d^2*x + a*d^2)*cos(b*x + a)*
log(-I*cos(b*x + a) + sin(b*x + a) + 1) + (b*d^2*x + a*d^2)*cos(b*x + a)*log(-I*cos(b*x + a) - sin(b*x + a) +
1) + (b*c*d - a*d^2)*cos(b*x + a)*log(-cos(b*x + a) + I*sin(b*x + a) + I) + (b*c*d - a*d^2)*cos(b*x + a)*log(-
cos(b*x + a) - I*sin(b*x + a) + I) + (b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2)*sin(b*x + a))/(b^3*cos(b*x + a))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c + d x\right )^{2} \sec ^{2}{\left (a + b x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)**2*sec(b*x+a)**2,x)

[Out]

Integral((c + d*x)**2*sec(a + b*x)**2, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)^2*sec(b*x+a)^2,x, algorithm="giac")

[Out]

integrate((d*x + c)^2*sec(b*x + a)^2, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (c+d\,x\right )}^2}{{\cos \left (a+b\,x\right )}^2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)^2/cos(a + b*x)^2,x)

[Out]

int((c + d*x)^2/cos(a + b*x)^2, x)

________________________________________________________________________________________